﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CM.DL.DALC.SAP;
using CM.BL.BE;

namespace CM.BL.BC
{
    public class PurchaseOrderBC
    {
        private string _connId = string.Empty;

        #region Singleton
        public static PurchaseOrderBC getInstance(string pConnId)
        {
            if (_instance == null)
            {
                lock (typeof(PurchaseOrderBC))
                {
                    if (_instance == null)
                    {
                        _instance = new PurchaseOrderBC(pConnId);
                    }
                }
            }
            return _instance;
        }
        private PurchaseOrderBC(string pConnId) { this._connId = pConnId; }
        private static volatile PurchaseOrderBC _instance = null;
        #endregion

        public string releasePO(string pPO, string pCodLib, out bool pLiberado)
        {
            return PurchaseOrderDALC.getInstance(CredencialesController.Usuario.Id).releasePO(pPO, pCodLib, out pLiberado);
        }

        public string getItemsForRelease(out List<PurchaseOrderBE> lstPO)
        {
            return PurchaseOrderDALC.getInstance(CredencialesController.Usuario.Id).getItemsForRelease(out lstPO);
        }
    }
}
